#include <sys_head.h>

int x = 0;

void * abc(void * p)
{
    while (1)
    {
        x++;
        printf("我是线程要执行的代码,x=%d\n",x);
        sleep(1);
    }
    
}

int main(int argc, char const *argv[])
{
    pthread_t pt;//线程的ID号，本质上是unsigned long类型
    for (size_t i = 0; i < 10; i++)
    {
        pthread_create(&pt,NULL,abc,NULL);
    }
    while (1)
    {
        x++;
        printf("我是主线程,x=%d\n",x);
        sleep(1);
    }
    
    return 0;
}
